Imports System
Imports System.Data
Imports System.Data.OleDb
'Imports MySql.Data.MySqlClient
Imports System.Data.SqlClient
Imports Microsoft.ApplicationBlocks.Data



Namespace Arwani

    ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' SQL Server implementation of the abstract DataProvider class
    ''' </summary>
    ''' <remarks>
    ''' </remarks>
    ''' <history>
    ''' </history>
    ''' -----------------------------------------------------------------------------
    Public Class SqlDataProvider
        Inherits DataProvider
#Region "Private Members"

        Private Const ProviderType As String = "data"
        Private Const ModuleQualifier As String = ""
        Private _connectionString As String

#End Region

#Region "Constructors"
        Public Sub New()
            '_connectionString = System.Configuration.ConfigurationManager.AppSettings("ArwaniDataConnectionString")
            _connectionString = System.Configuration.ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString()
        End Sub
#End Region
#Region "Properties"
        Public ReadOnly Property ConnectionString() As String
            Get
                Return _connectionString
            End Get
        End Property
#End Region

#Region "Public Methods"

        Public Overrides Function ExecuteQuery(ByVal strQuery As String) As DataSet
            'Return MySqlHelper.ExecuteDataset(ConnectionString, strQuery)
            Return SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, strQuery)
        End Function

        Public Overrides Sub ExecuteNonQuery(ByVal strQuery As String)
            'MySqlHelper.ExecuteNonQuery(ConnectionString, strQuery)
            SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.Text, strQuery)
        End Sub


#End Region
    End Class
End Namespace